#! /bin/sh

name=libintl
skip_pkg_check=yes
from_source=gettext
revision=1
hostdeps="gcc pkg-config"
deps="mlibc libgcc libstdc++ libatomic libiconv"

configure() {
    autotools_configure \
        --without-emacs \
        --without-lispdir \
        `# Normally this controls nls behavior in general, but the libintl` \
        `# subdir is skipped unless this is explicitly set.` \
        --enable-nls \
        `# This magic flag enables libintl.` \
        --with-included-gettext \
        --disable-c++ \
        --disable-libasprintf \
        --disable-java \
        --enable-threads=posix \
        --disable-curses \
        --without-git \
        --without-cvs \
        --without-bzip2 \
        --without-xz

    sed -i 's/touch $@//g' gettext-runtime/intl/Makefile
}

build() {
    make -C gettext-runtime/intl -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make -C gettext-runtime/intl install

    post_package_strip
}
